#include <stdio.h>
int main(){
    int top=0,cnt=0;
    char str[105];
    scanf("%s",str);
    while(str[cnt]!='\0'){
        if(str[cnt]=='('){
            top++;
        }else if(str[cnt]==')'){
            top--;
            if(top<0)break;
        }
        cnt++;
    }
    if(!top)printf("parentheses match!\n");
    else printf("parentheses do not match!");
    return 0;
}